<template>
	<view class="notice clearfix">
		<cu-custom bgColor="bg-white" isBack>
			<block slot="content">我的消息</block>
		</cu-custom>
		<view class="bg-white mt10 radius-5 px20 py15 flex flex-direction" @click="pushPage('/pages/user/article/article', { id: item.id })" v-for="(item, index) in List" :key="index">
			<view class="flex align-center justify-between">
				<view class="flex align-center">
					<image src="/static/my/info.png" class="block18" mode=""></image>
					<text class="ml10">{{item.title}}</text>
				</view>
				<text class="f12 text-info">{{item.addTime}}</text>
			</view>
			<view class="flex align-center justify-between mt10">
				<view class="f12 text-info ellipsis info-box">{{item.desc}}</view>
				<text class="text-info cuIcon-right"></text>
			</view>
		</view>
	</view>
</template>

<script>
import { mapState, mapActions } from 'vuex'
export default {
	data() {
		return {
			navbarColor: true,
		}
	},
	onLoad() {
		this.getData()
	},
	onReachBottom() {
		this.getData()
	},
	methods: {
		async getData() {
			if (this.finish) return
			let { data } = await this.$http.post('user.myinfo', { page: this.page })
			this.finish = data.length < 20
			!this.finish && (this.page += 1)
			this.List = [...this.List, ...data]
		}
	}
}
</script>

<style lang="less">
.info-box{
	width: calc(100% - 120rpx);
}
</style>
